﻿@model Article
@inject NetCoreCMS.IServices.IArticle_categoryService _article_category
@{
    Layout = null;
    Sysconfig config = ViewData["config"] as Sysconfig;
    List<Article> relNews = ViewBag.relNews as List<Article>;
}
<!DOCTYPE html>
<!--HTML5 doctype-->
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>@Model.title</title>
    <meta name="keywords" content="@Model.seo_keywords" />
    <meta name="description" content="@Model.seo_description" />
    <link rel="stylesheet" type="text/css" href="/mobile/css/style.css" />
    <script type="text/javascript" charset="utf-8" src="/mobile/js/zepto.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/weui.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/common.js"></script>
</head>

<body ontouchstart>
    <div class="page">
        <!--页面头部-->
        <div class="header">
            <a class="back" href="javascript:history.back();">
                <i class="iconfont icon-arrow-left"></i>
            </a>
            <h3>新闻资讯</h3>
            <div class="right">
                <a class="weui-cell_access weui-cell_link" href="javascript:;" onclick="showDialogBox('#category-box');">
                    <i class="iconfont icon-nav"></i>
                </a>
            </div>
        </div>
        <!--/页面头部-->
        <!--页面内容-->
        <div class="page__bd">
            <!--资讯介绍-->
            <div class="weui-panel weui-panel_access" style="margin-top:10px;">
                <div class="weui-panel__bd">
                    <div class="meta">
                        <h1 class="meta-tit">@Model.title</h1>
                        <p class="meta-info">
                            <span><i class="iconfont icon-date"></i>@Model.add_time</span>
                            <span>
                                <i class="iconfont icon-msg"></i>
                                <script type="text/javascript" src="/view_ajax?action=view_comment_count&channel_id=@Model.channel_id&id=@Model.id"></script>人评论
                            </span>
                            <span>
                                <i class="iconfont icon-view"></i>
                                <script type="text/javascript" src="/view_ajax?action=view_article_click&channel_id=@Model.channel_id&id=@Model.id&click=1"></script>次浏览
                            </span>
                        </p>
                    </div>
                    <div class="entry">
                        @Html.Raw(Model.content)
                    </div>
                </div>
            </div>
            <!--/资讯介绍-->
            <!--相关资讯-->
            <div class="weui-panel weui-panel_access">
                <div class="weui-panel__hd">相关资讯</div>
                <div class="weui-panel__bd">
                    <div class="txt-list">
                        <ul>                           
                            @foreach (Article dr in relNews)
                            {
                            <li>
                                <a asp-action="Show" asp-route-id="@dr.id">
                                    <i class="date">@dr.add_time.ToString("MM-dd")</i>
                                    <span class="text">@dr.title</span>
                                </a>
                            </li>
                            }
                            @if (relNews.Count < 1)
                            {
                                <div class="nodata">暂无相关...</div>
                            }
                        </ul>
                    </div>
                </div>
            </div>
            <!--/相关资讯-->
            <!--网友评论-->
            @if (Model.is_msg == 1)
            {
                @await Html.PartialAsync("~/Areas/Web/Views/Shared/_Comment_box.cshtml")
            }
                <!--/网友评论-->
                <!--版权信息-->
                @await Html.PartialAsync("~/Areas/Web/Views/Shared/_Copyright.cshtml")
                <!--/版权信息-->
                <!--底部导航-->
                @await Html.PartialAsync("~/Areas/Web/Views/Shared/_Footer.cshtml")
                <!--/底部导航-->
            </div>
        <!--/页面内容-->
    </div>

    <!--类别容器-->
    <div id="category-box" class="dialog-wrap">
        <div class="dialog-box">
            <div class="header">
                <a class="back" href="javascript:;" onclick="closeDialogBox('#category-box');">
                    <i class="iconfont icon-arrow-left"></i>
                </a>
                <h3>栏目类别</h3>
            </div>
            <ul class="navbar">
                @{var categoryList1 = _article_category.GetChildList(0,0,1);}
                @foreach(Article_category cdr1 in categoryList1)
                {
                <li>
                    <h3><a asp-action="List" asp-route-id="@cdr1.id">@cdr1.title</a></h3>
                    <p>
                        @{var categoryList2 = _article_category.GetChildList(0, cdr1.id, 1);}
                        @foreach (Article_category cdr2 in categoryList2)
                        {
                            if (cdr2.id == Model.category_id)
                            {
                        <a asp-action="List" asp-route-id="@cdr2.id" class="selected">@cdr2.title</a>
                            }
                            else
                            {
                    <a asp-action="List" asp-route-id="@cdr2.id">@cdr2.title</a>
                            }
                        }
                    </p>
                </li>
                }
            </ul>
        </div>
    </div>
    <!--类别容器-->

</body>
</html>
